<!DOCTYPE html>
<html>

<head lang="en">

	<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>南京大学职业咨询预约平台</title>
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <!-- No Baidu Siteapp-->
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='assets/i/ico_128X128.ico') }}">
    <!-- Add to homescreen for Chrome on Android -->
    <meta name="mobile-web-app-capable" content="yes">
    <link rel="icon" sizes="192x192" href="{{ url_for('static', filename='assets/i/app-icon72x72@2x.png') }}">
    <!-- Add to homescreen for Safari on iOS -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="apple-touch-icon-precomposed" href="{{ url_for('static', filename='assets/i/app-icon72x72@2x.png') }}">
    <!-- Tile icon for Win8 (144x144 + tile color) -->
    <meta name="msapplication-TileImage" content="{{ url_for('static', filename='assets/i/app-icon72x72@2x.png') }}">
    <meta name="msapplication-TileColor" content="#0e90d2">

    <link rel="stylesheet" href="{{ url_for('static', filename='assets/css/amazeui.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='assets/css/app.css', v='1.4') }}">
    <script src="{{ url_for('static', filename='assets/js/jquery.min.js') }}"></script>

    <style type="text/css">
    body {
    	text-align:center;
    }

    .mid {
    	margin: auto;
    	width: 100%;
    }

    </style>

</head>

    <body>
        <div class="Name">
        <njup>上传Excel文件 (xls, xlsx)</njup>
        </div>
        <br>

    	<div class="mid">
	    	<form action="/{{imadd|safe}}" method="post" enctype="multipart/form-data">
	    		{{ form.csrf_token }}
                <br>
                <div class="am-form-group am-form-file">
                  <button type="button" class="am-btn am-btn-default am-btn-xl">
                    <i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
                  <input type="file"  name="file" id="myfiles">
                </div>

                <input style="width: 100%;" type="text" class="am-btn" id="filename" value="">
                <br>
	            <input type="submit" class="am-btn am-btn-primary am-btn-xl" value="上传">
                
		    </form>
	    </div>

        <script>

        var pullfiles=function(){ 
            // love the query selector
            var fileInput = document.querySelector("#myfiles");
            var files = fileInput.files;
            // cache files.length 
            var fl=files.length;
            var i=0;

            while ( i < fl) {
                // localize file var in the loop
                var file = files[i];
                //alert(file.name);
                document.getElementById("filename").value = '已选文件：'+file.name;
                i++;
            }    
        }

        // set the input element onchange to call pullfiles
        document.querySelector("#myfiles").onchange=pullfiles;

        //a.t
        </script>
    </body>
    
</html>
